import { checkNotifications, request } from 'react-native-permissions';
/**
 *  Android 所有Check函数函数永远不会返回blocked状态，需要调用request获取权限信息
 */
export const hasPermission = {
  notification: async () => {
    const res = await checkNotifications();
    return res.status === 'granted';
  },
  requestNotification: async () => {
    const res = await checkNotifications();
    return res.status === 'granted';
  },
  /** 申请录音权限 */
  requestRecord: async () => {
    const res = await request('ios.permission.MICROPHONE');
    return res === 'granted';
  },
};
